<?php
/*************************************************************************
Admin Logout module
----------------------------------------------------------------
PICKCO CMS Project
Company: PICKCO  Co., Ltd  
Email: admin@pick.vn
Last updated: 02/07/2008
**************************************************************************/
$_SESSION['userId'] = 0;
$_SESSION['userName'] = '';
$_SESSION['userType'] = 0;

if(isset($_SESSION['adminId'])) {
	$_SESSION['userId'] = $_SESSION['adminId'];
	$_SESSION['adminId'] = '';
	if (!headers_sent($filename, $linenum)) {
		header('location: '.ADMIN_SCRIPT.'?op=login');
		exit;
	// You would most likely trigger an error here.
	} else {
		echo "Headers already sent in $filename on line $linenum\n";
		exit;
	}	
} else {
	if (!headers_sent($filename, $linenum)) {
		header('location: '.ADMIN_SCRIPT);
		exit;
	// You would most likely trigger an error here.
	} else {
		echo "Headers already sent in $filename on line $linenum\n";
		exit;
	}	
}
?>